package com.lyy.king.common.utils.utils;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassDescription:
 * @JdkVersion: 1.8
 * @Author: cdx
 * @Created: 2023/12/26 20:53
 */
public class LoggerUtils {
    private static boolean INFO_SWITCH = true;
    private static boolean WARN_SWITCH = true;
    private static boolean ERROR_SWITCH = true;

    /**
     * 获取日志
     */
    public static Logger getLogger(Class aClass){
        return LoggerFactory.getLogger(aClass);
    }

    /**
     * 普通日志
     * @param logger
     * @param message
     * @param args
     */
    public static void info(Logger logger, String message, Object... args){

        if(INFO_SWITCH){
            logger.info(message,args);
        }
    }

    /**
     * 警告日志
     * @param logger
     * @param message
     * @param args
     */
    public static void warn(Logger logger, String message, Object... args){
        if(WARN_SWITCH){
            logger.warn(message,args);
        }
    }

    /**
     * 错误日志
     * @param logger
     * @param message
     * @param args
     */
    public static void error(Logger logger, String message, Object... args){
        if(WARN_SWITCH){
            logger.error(message,args);
        }
    }
}
